<?php

namespace app\common\model;

use think\Model;

class GoodsSku extends Model
{

    // 关联产品信息
    public function goods()
    {
		return $this->belongsTo('Goods', 'goods_id', 'id')
			->field('id,shop_id,goods_name');
    }

    /**
     * 获取skuInfo
     *
     * @param [type] $sku_id
     * @return void
     */
    public function getInfo($sku_id)
    {
        $info = $this->with('goods')->where('sku_id', $sku_id)->find();

        return $info;
    }
}
